const router = require('koa-router')()
const { live } = require('../mysql/index.js')

router.post('/live', async (ctx, next) => {
  try {
    const res = await live()
    ctx.body = {
      code: '1',
      data: res,
      msg: '查找成功'
    }
  } catch (error) {
    ctx.body = {
      code: '2',
      data: error,
      msg: '服务器异常'
    }
  }
  next()
})

module.exports = router